ubus: fix ubus announcements txt fields
authorAndrew Karpow <[email protected]>
Sun, 25 May 2025 04:02:39 +0000 (00:02 -0400)
committerFelix Fietkau <[email protected]>
Wed, 28 May 2025 22:28:43 +0000 (00:28 +0200)
commit695ac3708aa014aee9be77f91da2699eef1b4c66
treedb420657e0ca284fd68d3abbd192232d0269f310
parent632953a1582dceb3472ed459c03df1fbb5e0717b
ubus: fix ubus announcements txt fields

The txt field of multicast dns is defined as an array of concatenated
length-values, where length is encoded in the first byte and value is a
non-NUL terminated string.
The ubus announcements callback tokenized the txt buffer by dividing
it between non-ASCII characters. This works fine for values with a
length <32 characters, but not for longer strings.
This patch correctly deserializes the txt values and removes the need
for dynamic allocation.

Signed-off-by: Andrew Karpow <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]> [minor cleanup]
ubus.c